using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._NetworkDiagramTools._Configuration
{
    /// <summary>
    /// <para>Add Reduce Junction By Attribute Rule</para>
    /// <para>Adds a diagram rule to automatically reduce diagram junctions during diagram building based on an existing template. The junctions to reduce are queried from a given network junction source class or object table by attributes according to the number of other junctions to which they are connected.</para>
    /// <para>添加逻辑示意图规则，以在基于现有模板构建逻辑示意图期间自动减少逻辑示意图交汇点。要减少的交汇点是根据它们所连接的其他交汇点的数量，按属性从给定的网络交汇点源类或对象表中查询的。</para>
    /// </summary>    
    [DisplayName("Add Reduce Junction By Attribute Rule")]
    public class AddReduceJunctionByAttributeRule : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AddReduceJunctionByAttributeRule()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_utility_network">
        /// <para>Input Network</para>
        /// <para>The utility network or trace network containing the diagram template to modify.</para>
        /// <para>包含要修改的逻辑示意图模板的公共设施网络或追踪网络。</para>
        /// </param>
        /// <param name="_template_name">
        /// <para>Input Diagram Template</para>
        /// <para>The name of the diagram template to modify.</para>
        /// <para>要修改的逻辑示意图模板的名称。</para>
        /// </param>
        /// <param name="_is_active">
        /// <para>Active</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the rule will be active when generating and updating diagrams based on the specified template.
        ///   <bulletList>
        ///     <bullet_item>Checked—The added rule will become active during the generation and update of any diagrams based on the input template. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—The added rule will not become active during the generation or update of any diagrams based on the input template.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定在基于指定模板生成和更新关系图时，规则是否处于活动状态。
        ///   <bulletList>
        ///     <bullet_item>选中 - 在基于输入模板生成和更新任何逻辑示意图期间，添加的规则将变为活动状态。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>未选中 - 在基于输入模板生成或更新任何逻辑示意图期间，添加的规则将不会变为活动状态。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_junction_source">
        /// <para>Junction Source to Reduce</para>
        /// <para>The network junction source class or object table to process. All diagram junctions related to network junctions that belong to this source class or object table are reduction candidates.</para>
        /// <para>要处理的网络联结源类或对象表。与属于此源类或对象表的网络交汇点相关的所有逻辑示意图交汇点都是约简候选项。</para>
        /// </param>
        public AddReduceJunctionByAttributeRule(object _in_utility_network, object _template_name, _is_active_value _is_active, object _junction_source)
        {
            this._in_utility_network = _in_utility_network;
            this._template_name = _template_name;
            this._is_active = _is_active;
            this._junction_source = _junction_source;
        }
        public override string ToolboxName => "Network Diagram Tools";

        public override string ToolName => "Add Reduce Junction By Attribute Rule";

        public override string CallName => "nd.AddReduceJunctionByAttributeRule";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_utility_network, _template_name, _is_active.GetGPValue(), _junction_source, _where_clause, _connectivity_options.GetGPValue(), _unconnected_junctions.GetGPValue(), _one_connected_junction.GetGPValue(), _two_connected_junctions.GetGPValue(), _edges_attributes, _description, _out_utility_network, _out_template_name];

        /// <summary>
        /// <para>Input Network</para>
        /// <para>The utility network or trace network containing the diagram template to modify.</para>
        /// <para>包含要修改的逻辑示意图模板的公共设施网络或追踪网络。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Network")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_utility_network { get; set; }


        /// <summary>
        /// <para>Input Diagram Template</para>
        /// <para>The name of the diagram template to modify.</para>
        /// <para>要修改的逻辑示意图模板的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Diagram Template")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _template_name { get; set; }


        /// <summary>
        /// <para>Active</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the rule will be active when generating and updating diagrams based on the specified template.
        ///   <bulletList>
        ///     <bullet_item>Checked—The added rule will become active during the generation and update of any diagrams based on the input template. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—The added rule will not become active during the generation or update of any diagrams based on the input template.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定在基于指定模板生成和更新关系图时，规则是否处于活动状态。
        ///   <bulletList>
        ///     <bullet_item>选中 - 在基于输入模板生成和更新任何逻辑示意图期间，添加的规则将变为活动状态。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>未选中 - 在基于输入模板生成或更新任何逻辑示意图期间，添加的规则将不会变为活动状态。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Active")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _is_active_value _is_active { get; set; }

        public enum _is_active_value
        {
            /// <summary>
            /// <para>ACTIVE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ACTIVE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>INACTIVE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("INACTIVE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Junction Source to Reduce</para>
        /// <para>The network junction source class or object table to process. All diagram junctions related to network junctions that belong to this source class or object table are reduction candidates.</para>
        /// <para>要处理的网络联结源类或对象表。与属于此源类或对象表的网络交汇点相关的所有逻辑示意图交汇点都是约简候选项。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Junction Source to Reduce")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _junction_source { get; set; }


        /// <summary>
        /// <para>Expression</para>
        /// <para>An SQL expression used to select the subset of network junctions from the junction reduction candidates in the diagrams based on the input template. For more information on SQL syntax, see the SQL reference for query expressions used in ArcGIS help topic.</para>
        /// <para>一个 SQL 表达式，用于根据输入模板从逻辑示意图中的交汇点缩减候选项中选择网络交汇点的子集。有关 SQL 语法的详细信息，请参阅 ArcGIS 帮助中使用的查询表达式的 SQL 参考主题。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Expression")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _where_clause { get; set; } = null;


        /// <summary>
        /// <para>Reduce Junctions With</para>
        /// <para><xdoc>
        ///   <para>Specifies the number of junction connections that will be considered for reduction.</para>
        ///   <bulletList>
        ///     <bullet_item>Maximum two connected junctions—Junctions with two or less connections will be considered. In this case, a specific process will be executed according to the number of candidate junction connections that will be reduced. This is the default.</bullet_item><para/>
        ///     <bullet_item>Minimum three connected junctions—Junctions with three or more connections will be considered. In this case, upstream traces will be executed to determine whether candidate junction connections will be reduced.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将考虑减少的交汇点连接数。</para>
        ///   <bulletList>
        ///     <bullet_item>最多两个连接的交汇点—将考虑具有两个或两个更少连接的交汇点。在这种情况下，将根据将减少的候选交汇点连接数执行特定过程。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>至少三个连接的交汇点—将考虑具有三个或更多连接的交汇点。在这种情况下，将执行上游跟踪以确定是否将减少候选交汇点连接。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Reduce Junctions With")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _connectivity_options_value _connectivity_options { get; set; } = _connectivity_options_value._MAX_2_CONNECTED_JUNCTIONS;

        public enum _connectivity_options_value
        {
            /// <summary>
            /// <para>Maximum two connected junctions</para>
            /// <para>Maximum two connected junctions—Junctions with two or less connections will be considered. In this case, a specific process will be executed according to the number of candidate junction connections that will be reduced. This is the default.</para>
            /// <para>最多两个连接的交汇点—将考虑具有两个或两个更少连接的交汇点。在这种情况下，将根据将减少的候选交汇点连接数执行特定过程。这是默认设置。</para>
            /// </summary>
            [Description("Maximum two connected junctions")]
            [GPEnumValue("MAX_2_CONNECTED_JUNCTIONS")]
            _MAX_2_CONNECTED_JUNCTIONS,

            /// <summary>
            /// <para>Minimum three connected junctions</para>
            /// <para>Minimum three connected junctions—Junctions with three or more connections will be considered. In this case, upstream traces will be executed to determine whether candidate junction connections will be reduced.</para>
            /// <para>至少三个连接的交汇点—将考虑具有三个或更多连接的交汇点。在这种情况下，将执行上游跟踪以确定是否将减少候选交汇点连接。</para>
            /// </summary>
            [Description("Minimum three connected junctions")]
            [GPEnumValue("MIN_3_CONNECTED_JUNCTIONS")]
            _MIN_3_CONNECTED_JUNCTIONS,

        }

        /// <summary>
        /// <para>Reduce if unconnected</para>
        /// <para><xdoc>
        ///   <para>Specifies whether each unconnected network diagram junction candidate will be reduced. This parameter is only active when Reduce Junctions With is set to Maximum two connected junctions.
        ///   <bulletList>
        ///     <bullet_item>Checked—Unconnected network diagram junction candidates will be reduced. Each junction will be removed.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—Unconnected network diagram junction candidates will not be reduced; they will be kept. This is the default.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定是否将减少每个未连接的网络逻辑示意图交汇点候选。仅当“减少结点”设置为“最多两个连接的交汇点”时，此参数才处于活动状态。
        ///   <bulletList>
        ///     <bullet_item>选中—将减少未连接的网络逻辑示意图候选交汇点。每个交汇点都将被移除。 </bullet_item><para/>
        ///     <bullet_item>未选中—未连接的网络逻辑示意图候选交汇点不会减少;它们将被保留。这是默认设置。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Reduce if unconnected")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _unconnected_junctions_value _unconnected_junctions { get; set; } = _unconnected_junctions_value._false;

        public enum _unconnected_junctions_value
        {
            /// <summary>
            /// <para>REDUCE_UNCONNECTED_JCT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("REDUCE_UNCONNECTED_JCT")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>KEEP_UNCONNECTED_JCT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("KEEP_UNCONNECTED_JCT")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Reduce if connected to a single junction</para>
        /// <para><xdoc>
        ///   <para>Specifies whether each network diagram junction reduction candidate that is connected to a single junction will be reduced. This parameter is only active when Reduce Junctions With is set to Maximum two connected junctions.
        ///   <bulletList>
        ///     <bullet_item>Checked—Network diagram junction reduction candidates that are connected to a single junction will be reduced. Each junction and its incident edge will be reduced onto its single connected junction.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—Network diagram junction reduction candidates that are connected to a single junction will not be reduced; they will be kept. This is the default.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定是否将减少连接到单个交汇点的每个网络逻辑示意图交汇点缩减候选项。仅当“减少结点”设置为“最多两个连接的交汇点”时，此参数才处于活动状态。
        ///   <bulletList>
        ///     <bullet_item>选中 - 将减少连接到单个交汇点的网络逻辑示意图交汇点缩减候选项。每个交汇点及其入射边将减少到其单个连接的交汇点上。 </bullet_item><para/>
        ///     <bullet_item>未选中—连接到单个交汇点的网络逻辑示意图交汇点缩减候选节点将不被缩减;它们将被保留。这是默认设置。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Reduce if connected to a single junction")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _one_connected_junction_value _one_connected_junction { get; set; } = _one_connected_junction_value._false;

        public enum _one_connected_junction_value
        {
            /// <summary>
            /// <para>REDUCE_JCT_TO_1JCT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("REDUCE_JCT_TO_1JCT")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>KEEP_JCT_TO_1JCT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("KEEP_JCT_TO_1JCT")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Reduce if connected to 2 different junctions</para>
        /// <para><xdoc>
        ///   <para>Specifies whether each network diagram junction reduction candidate that is connected to two other junctions will be reduced. This parameter is only active when Reduce Junctions With is set to Maximum two connected junctions.
        ///   <bulletList>
        ///     <bullet_item>Checked—Network diagram junction reduction candidates that connect two other junctions will be reduced. Each junction and its incident edges will be reduced onto a super span edge (the reduction edge). This is the default.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—Network diagram junction reduction candidates that connect two other junctions will not be reduced; they will be kept.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定是否将减少连接到其他两个交汇点的每个网络逻辑示意图交汇点缩减候选项。仅当“减少结点”设置为“最多两个连接的交汇点”时，此参数才处于活动状态。
        ///   <bulletList>
        ///     <bullet_item>选中—将缩减连接另外两个交汇点的网络逻辑示意图缩减候选节点。每个交汇点及其入射边将被简化为超跨边（缩减边）。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>未选中—连接另外两个交汇点的网络逻辑示意图缩减候选节点将不被缩减;它们将被保留。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Reduce if connected to 2 different junctions")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _two_connected_junctions_value _two_connected_junctions { get; set; } = _two_connected_junctions_value._true;

        public enum _two_connected_junctions_value
        {
            /// <summary>
            /// <para>REDUCE_JCT_TO_2JCTS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("REDUCE_JCT_TO_2JCTS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>KEEP_JCT_TO_2JCTS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("KEEP_JCT_TO_2JCTS")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Edge Attribute Names</para>
        /// <para><xdoc>
        ///   <para>The alias of the edge attributes adjacent to the junction reduction candidate.</para>
        ///   <para>The junction will be reduced only when all of its adjacent edges have the same values for each specified attribute alias.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>与结点缩减候选项相邻的边属性的别名。</para>
        ///   <para>仅当交汇点的所有相邻边对每个指定的属性别名具有相同的值时，交汇点才会被缩小。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Edge Attribute Names")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _edges_attributes { get; set; } = null;


        /// <summary>
        /// <para>Description</para>
        /// <para>The description of the rule.</para>
        /// <para>规则的说明。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Description")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _description { get; set; } = null;


        /// <summary>
        /// <para>Output Network</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Network")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_utility_network { get; set; }


        /// <summary>
        /// <para>Output Diagram Template</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Diagram Template")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_template_name { get; set; }


        public AddReduceJunctionByAttributeRule SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}